import { Modal } from 'ant-design-vue';
import { i18n } from '@/utils/language';

export class ModalDialog {
  static showConfirm(content: string, okCallback: Function) {
    return Modal.confirm({
      title: `${i18n.t('confirm')}`,
      content: content,
      okText: `${i18n.t('ok')}`,
      cancelText: `${i18n.t('cancel')}`,
      onOk: () => {
        return okCallback();
      },
      onCancel: () => {}
    });
  }

  static showError(title: string, content: string) {
    return Modal.error({
      title: `${i18n.t(title)}`,
      content: content,
      okText: `${i18n.t('ok')}`
    });
  }
}

export default ModalDialog;
